package com.ujiuye.dome;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

import java.io.File;
import java.io.IOException;

public class POIDemo {
    public static void main(String[] args) throws IOException {
        //创建工作簿
        HSSFWorkbook workbook = new HSSFWorkbook();
        //创建工作表
        HSSFSheet sheet = workbook.createSheet("套餐列表");
        //创建行
        HSSFRow row = sheet.createRow(0);
        row.createCell(0).setCellValue("jack");
        row.createCell(1).setCellValue("tome");
        row.createCell(2).setCellValue("keke");
        row.createCell(3).setCellValue("lili");
        //创建文件
        File file = new File("C:/Users/Administrator/Desktop/upload/info.xls");
        workbook.write(file);
        System.out.println("创建成功");

    }
}
